home *** CD-ROM | disk | FTP | other *** search
/ Apple Reference & Presen…tion Library 4 (Reseller) / Apple Ref. & Pres. Lib.v4.0.iso / 4-Demos / Apple Demos / Tutorials / Display Card 4•8⁄8•24 Training / Display Card 4•8_8•24 Training / background_27732.txt < prev    next >
Text File  |  1990-03-19  |  5KB  |  227 lines

  1. -- background: 27732 from stack: in
  2. -- bmap block id: 29799
  3. -- flags: 0000
  4. -- background id: 0
  5. -- name: checkBack
  6. ----- HyperTalk script -----
  7. on fixResponses -- called from openCard on tests 1-4
  8.   repeat with r = 1 to the number of cd flds
  9.     if word 1 of the short name of cd fld r = "answer" then
  10.       put word 2 of the short name of cd fld r into rLine
  11.       get line rLine of cd fld "Your Responses"
  12.       if it <> "" then
  13.         put line rLine of cd fld "Your Responses" into cd fld r
  14.       else
  15.         put "" into cd fld r
  16.       end if
  17.     end if
  18.   end repeat
  19. end fixResponses
  20.  
  21. on toggleResponses -- called by mouseup in Answer fields in tests 1-3
  22.   put word 2 of the short name of target into rLine
  23.   repeat with r = 1 to the number of cd flds
  24.     if word 1 of the short name of cd fld r = "Responses" then hide cd fld r
  25.   end repeat
  26.   set the visible of cd fld ("Responses" && rLine) to true
  27. end toggleResponses
  28.  
  29. on chooseResponses -- called by mouseup in Responses fields in tests 1-3
  30.   global inProgress
  31.   put true into inProgress
  32.   put clickline() into temp
  33.   put (word 2 of the short name of target) into rLine
  34.   put line temp of cd fld ("Responses" && rLine) into cd fld ("Answer" && rLine)
  35.   put cd fld ("Answer" && rLine) into line rLine of cd fld "Your Responses"
  36.   hide cd fld ("Responses" && rLine)
  37.   put temp into line rLine of cd fld "Your Answers"
  38. end chooseResponses
  39.  
  40. on ScoreReview
  41.   global memolist, testnumber, correct, incorrect
  42.   put "0" into correct
  43.   put "0" into incorrect
  44.   answer "Do you want to review your scores?" with "No" or "Yes"
  45.   if it is "No" then go card "test 0"
  46.   else
  47.     put 1 into s
  48.     repeat with s = 1 to the number of items in memolist
  49.       if item s of memolist = "true" then add 1 to correct
  50.       else add 1 to incorrect
  51.       add 1 to s
  52.     end repeat
  53.     go card "test 7"
  54.     put correct into line testNumber of cd fld "correct"
  55.     put incorrect into line testNumber of cd fld "incorrect"
  56.   end if
  57. end ScoreReview
  58.  
  59.  
  60.  
  61. -- part 6 (field)
  62. -- low flags: 01
  63. -- high flags: 0000
  64. -- rect: left=126 top=80 right=308 bottom=510
  65. -- title width / last selected line: 0
  66. -- icon id / first selected line: 0 / 0
  67. -- text alignment: 0
  68. -- font id: 156
  69. -- text size: 14
  70. -- style flags: 0
  71. -- line height: 16
  72. -- part name: cardtext
  73.  
  74.  
  75. -- part 4 (field)
  76. -- low flags: 01
  77. -- high flags: 0000
  78. -- rect: left=128 top=0 right=21 bottom=508
  79. -- title width / last selected line: 0
  80. -- icon id / first selected line: 0 / 0
  81. -- text alignment: 0
  82. -- font id: 21
  83. -- text size: 18
  84. -- style flags: 10240
  85. -- line height: 19
  86. -- part name: Title
  87.  
  88.  
  89. -- part 5 (field)
  90. -- low flags: 01
  91. -- high flags: 0000
  92. -- rect: left=128 top=23 right=45 bottom=508
  93. -- title width / last selected line: 0
  94. -- icon id / first selected line: 0 / 0
  95. -- text alignment: 0
  96. -- font id: 21
  97. -- text size: 18
  98. -- style flags: 0
  99. -- line height: 20
  100. -- part name: cardTitle
  101.  
  102.  
  103. -- part 10 (field)
  104. -- low flags: 01
  105. -- high flags: 0000
  106. -- rect: left=127 top=64 right=82 bottom=512
  107. -- title width / last selected line: 0
  108. -- icon id / first selected line: 0 / 0
  109. -- text alignment: 0
  110. -- font id: 158
  111. -- text size: 14
  112. -- style flags: 0
  113. -- line height: 16
  114. -- part name: subHeader
  115.  
  116.  
  117. -- part 9 (field)
  118. -- low flags: 81
  119. -- high flags: 0000
  120. -- rect: left=0 top=330 right=342 bottom=115
  121. -- title width / last selected line: 0
  122. -- icon id / first selected line: 0 / 0
  123. -- text alignment: 0
  124. -- font id: 3
  125. -- text size: 9
  126. -- style flags: 0
  127. -- line height: 9
  128. -- part name: cardName
  129.  
  130.  
  131. -- part 16 (field)
  132. -- low flags: 81
  133. -- high flags: 0000
  134. -- rect: left=0 top=330 right=342 bottom=96
  135. -- title width / last selected line: 0
  136. -- icon id / first selected line: 0 / 0
  137. -- text alignment: 0
  138. -- font id: 3
  139. -- text size: 9
  140. -- style flags: 0
  141. -- line height: 9
  142. -- part name: cardName
  143.  
  144.  
  145. -- part 17 (button)
  146. -- low flags: 00
  147. -- high flags: 2000
  148. -- rect: left=428 top=317 right=342 bottom=456
  149. -- title width / last selected line: 0
  150. -- icon id / first selected line: 18611 / 18611
  151. -- text alignment: 1
  152. -- font id: 0
  153. -- text size: 12
  154. -- style flags: 0
  155. -- line height: 16
  156. -- part name: prev
  157. ----- HyperTalk script -----
  158. on mouseUp
  159.   visual scroll right
  160.   go prev
  161. end mouseUp
  162.  
  163.  
  164.  
  165. -- part 18 (button)
  166. -- low flags: 00
  167. -- high flags: 2000
  168. -- rect: left=457 top=317 right=342 bottom=484
  169. -- title width / last selected line: 0
  170. -- icon id / first selected line: 18612 / 18612
  171. -- text alignment: 1
  172. -- font id: 0
  173. -- text size: 12
  174. -- style flags: 0
  175. -- line height: 16
  176. -- part name: next
  177. ----- HyperTalk script -----
  178. on mouseUp
  179.   if word 2 of the short name of this card = "0" then
  180.     visual dissolve
  181.     go next
  182.   else
  183.     visual scroll left
  184.     go next
  185.   end if
  186. end mouseUp
  187.  
  188.  
  189.  
  190. -- part 21 (button)
  191. -- low flags: 00
  192. -- high flags: A000
  193. -- rect: left=449 top=3 right=18 bottom=510
  194. -- title width / last selected line: 0
  195. -- icon id / first selected line: 0 / 0
  196. -- text alignment: 0
  197. -- font id: 3
  198. -- text size: 10
  199. -- style flags: 2048
  200. -- line height: 13
  201. -- part name: Contents
  202. ----- HyperTalk script -----
  203. on mouseUp
  204.   visual effect dissolve
  205.   go card "content 0"
  206. end mouseUp
  207.  
  208.  
  209.  
  210. -- part 22 (button)
  211. -- low flags: 00
  212. -- high flags: 2000
  213. -- rect: left=484 top=317 right=342 bottom=512
  214. -- title width / last selected line: 0
  215. -- icon id / first selected line: 18613 / 18613
  216. -- text alignment: 1
  217. -- font id: 0
  218. -- text size: 12
  219. -- style flags: 0
  220. -- line height: 16
  221. -- part name: return
  222. ----- HyperTalk script -----
  223. on mouseUp
  224.   go card "test 0"
  225. end mouseUp
  226.  
  227.